<?php
/**
 * Controller is the customized base controller class.
 * All controller classes for this application should extend from this base class.
 */
class Controller extends RController
{
	/**
	 * @var mixed the default tooltip for every controller.
	 * if you give to this parameter a boolean false value instead of an array,
	 * the controller will not be displayed in the permission menagement view.
	 * for more information view the documentation in the userGroups module.
	 */
	public static $_permissionControl = array('read' => false, 'write' => false, 'admin' => false);
	/**
	 * @var string the default layout for the controller view. Defaults to '//layouts/main',
	 * meaning using a single column layout. See 'protected/views/layouts/main.php'.
	 */
	public $layout='//layouts/column2';
	/**
	 * @var array context menu items. This property will be assigned to {@link CMenu::items}.
	 */
	public $menu=array();
	
	/**
	 * 
	 * thong ke cong viec da nhan, da gui = ajax trong AjaxThongKeController
	 */
	public $thongke_danhan=array(array()); // 
	public $thongke_dagui=array(array());
	/**
	 * @var array the breadcrumbs of the current page. The value of this property will
	 * be assigned to {@link CBreadcrumbs::links}. Please refer to {@link CBreadcrumbs::links}
	 * for more details on how to specify this property.
	 */
	public $breadcrumbs=array();
	/**
	 * The filter method for 'UserGroupsAccessControl' filter.
	 * This filter is a wrapper of {@link UserGroupsAccessControl}.
	 * To use this filter, you must override {@link accessRules} method.
	 * @param CFilterChain $filterChain the filter chain that the filter is on.
	 */		
	public function filter()
	{
		return array(
			'rights'
		);
	}
	/**
	 * tra ve id user dang nhap
	 * goi. $this->user 
	 */
	public function getUser()
	{
		return CanBoVienChuc::model()->maCb;
	}
	
	protected function getFilePath()
	{
		$model=CauHinhWeb::model()->find(array(
				'condition'=>'ten_cau_hinh=:x',
				'params'=>array(':x'=>'thu_muc_chua_file_qlcv')));
		return $model->gia_tri;
	}
	
	
	/**
	 * bien kiem tra cac item the hien theo quyen o menu
	 */

	
	/*
	public function filterUserGroupsAccessControl($filterChain)
	{
		Yii::import('userGroups.models.UserGroupsUser');
		Yii::import('userGroups.models.UserGroupsConfiguration');
		Yii::import('userGroups.components.UserGroupsAccessControl');
		$filter=new UserGroupsAccessControl;
		$filter->setRules($this->accessRules());
		$filter->filter($filterChain);
	}*/

}